<template>
    <div>
        <h2 ref="text" v-text='msg'></h2>
        <button ref="btn" @click='showDom'>点我输出上方DOM元素</button>
        <School ref="sch"/>
    </div>
</template>

<script>
import School from './components/School.vue';
export default {
    name:'app',
    components:{School},
    data() {
        return {
            msg:'欢迎学习Vue'
        }
    },
    methods:{
        showDom(){
            console.log(this.$refs.text)
            console.log(this.$refs.btn)
            console.log(this.$refs.sch)
        }
    }
}
</script>

<style>

</style>